www.gusucode.com > 6KBBS ASP版 V7.1 > 6KBBS ASP版 V7.1\code\bbs\Reg.asp
<!--#include file="up.asp"--> <link rel="stylesheet" type="text/css" href="skin/<%=Cssstyleid%>/bbs.css"> <% dim action action=request.querystring("action") select case action case"" %> <div class=reg> <div class=regtitle> 用户注册条款和声明 </div> <div class=regbody> <b>继续注册前请先阅读论坛协议</b><br> 欢迎您加入本站点参加交流和讨论,本站点为公共论坛,为维护网上公共秩序和社会稳定,请您自觉遵守以下条款:<br> <br> 一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播下列信息:<br> (一)煽动抗拒、破坏宪法和法律、行政法规实施的;<br> (二)煽动颠覆国家政权,推翻社会主义制度的;<br> (三)煽动分裂国家、破坏国家统一的;<br> (四)煽动民族仇恨、民族歧视,破坏民族团结的;<br> (五)捏造或者歪曲事实,散布谣言,扰乱社会秩序的;<br> (六)宣扬封建迷信、淫秽、色情、赌博、暴力、凶杀、恐怖、教唆犯罪的;<br> (七)公然侮辱他人或者捏造事实诽谤他人的,或者进行其他恶意攻击的;<br> (八)损害国家机关信誉的;<br> (九)其他违反宪法和法律行政法规的;<br> (十)进行商业广告行为的。<br> <br> 二、互相尊重,对自己的言论和行为负责。</p> <form method="POST" action="reg.asp?action=agree"> <div align=center><input type="submit" value=" 我 同 意 " name="B1"></div></form> </div> </div> <%case"agree"%> <script>function openwin() { document.form1.name.value=document.form.name.value; document.form1.email.value=document.form.email.value; var popupWin = window.open('', 'showgg', 'width=500,height=400,resizable=1,scrollbars=yes,menubar=no,status=yes'); document.form1.submit() } </SCRIPT> <form name=form1 action=paper.asp?action=checkreg method=post target=showgg> <input type=hidden name=name value=><input type=hidden name=email value=> </form> <form method="POST" action="reg.asp?action=save" name="form"> <table class="userreg" cellpadding="0" style="border-collapse: collapse" width="100%"> <tr> <td><div class=userregtitle>用户资料注册</div></td> </tr> <tr> <td class=userregtitle2>必填资料:</td> </tr> <tr> <td> <table width="100%"> <tr> <td width="40%"> <p style="line-height: 120%; margin: 4"><b>用户名:</b><br>注册用户名不能超过16个字符(8个汉字) 。</p></td> <td width="60%"> <input type=text name=name size=30 maxlength=16> <input type="button" value=" 检测用户名 " onclick=openwin() name="B1"></td> </tr> <tr> <td><p style="line-height: 120%; margin: 4"><b>性别:</b><br>请选择您的性别</td> <td> <input type=radio name=sex value=1 checked> <img src="images/boy.gif">帅哥 <input type=radio name=sex value=2> <img src="images/girl.gif">靓女</td> </tr> <tr> <td><p style="line-height: 120%; margin: 4"> <b>密码(最多16位):</b><br>请不要使用任何类似 '*'、' ' 或 HTML 字符。</td> <td> <input type=password name=password size=30 maxlength=20></td> </tr> <tr> <td><p style="line-height: 120%; margin: 4"><b>重复密码(最多16位):</b><br>请再输一遍确认 。</td> <td> <input type=password name=repassword size=30 maxlength=20></td> </tr> <tr> <td><p style="line-height: 120%; margin: 4"><b>Email地址:</b><br>请输入有效的邮件地址,这将使您能用到论坛中的所有功能 。</td> <td> <input type=text name=email size=30 maxlength=30></td> </tr> <tr> <td><p style="line-height: 120%; margin: 4"><b>注册验证码:</b><br>如无法显示或看不清,请刷新本页 。</td> <td> <input type="text" class=submit name="adminid" size="16"> 请输入:<img src=code.asp border=0></td> </tr> </table> </td> </tr> <tr> <td class=userregtitle2>选填资料:</td> </tr> <tr> <td width="100%"> <table width="100%"> <tr> <td width="40%"><p style="line-height: 120%; margin: 4"><b>生日:</b>(请按照2000-01-01格式填写)</td> <td width="60%"> <input type=text name=burn1 size=4 maxlength=4>年<input type=text name=burn2 size=2 maxlength=2>月<input type=text name=burn3 size=2 maxlength=2>日</td> </tr> <tr> <td><p style="line-height: 120%; margin: 4"><b>主页:</b><br> 填写你的个人主页,让大家见识见识。</td> <td> <input type=text name=home size=30 maxlength=255></td> </tr> <tr> <td><p style="line-height: 120%; margin: 4"><b>OICQ号码:</b><BR>填写您的QQ地址,方便与他人的联系 。</td> <td> <input type=text name=qq size=16 maxlength=15></td> </tr> <tr> <td><p style="line-height: 120%; margin: 4"><b>我的头像:</b><br>使用论坛自带的图像。</td> <td><br> <select name=bbspic size=1 onChange="showimage()"> <%for i=1 to checknum(application(prefix&"picnum"))%> <option value=<%=i%>><%=i%></option> <%next%> </select> <img src="images/headpic/1.gif" name="tus"><script>function showimage(){document.images.tus.src="images/headpic/"+document.form.bbspic.options[document.form.bbspic.selectedIndex].value+".gif";}</script> [ <a target="_blank" href="help.asp?action=allheadpic">查看所有头像</a> ]<br> </td> </tr> <tr> <td><p style="line-height: 120%; margin: 4"><b>自定义头像:</b><br>如果图像位置中有连接图片将以自定义的为主 。</td> <td> <input name=mypic size=38 maxlength=100> 完整Url地址<br> 图像宽度:<input type=text name=picw size=6 value=<%=checknum(application(prefix&"picw"))%>> 高度: <input type=text name=pich size=6 value=<%=checknum(application(prefix&"pich"))%>>(宽最大<%=checknum(application(prefix&"picw"))%> 高最大<%=checknum(application(prefix&"pich"))%>)</td> </tr> <tr> <td><p style="line-height: 120%; margin: 4"><b>个性签名:</b><BR>最多255个字符<BR>文字将出现在您发表的文章的结尾处。体现您的个性。</td> <td> <p style="margin: 8"> <TEXTAREA name=gxqm rows=5 wrap=PHYSICAL cols=60></TEXTAREA></td> </tr> </table> </td> </tr> <tr> <td class=regbutton align="center" height="30"><input class=submit type=submit value=我填好了,现在注册! name=Submit> <input class=submit type=reset value=不行,还是重写吧! name=Submit2></td> </tr> </table></div> </form> <%case"save"%><!--#include file="inc/regfun.asp"--><% dim name,password,repassword,email,sex,burn1,burn2,burn3,burn,home,qq,gxqm,picw,pich,bbspic,mypic,toupic dim canreg,badwords,z,adminid,sickpass,userinfo,regtime,sql,userid,newuserinfo,bad,b function checkbad(str) if isnull(str) then exit function bad=split(application(prefix&"badcontent"), "|") for b=0 to ubound(bad) str=Replace(str,bad(b),string(len(bad(b)),"*")) next checkbad=str end function name=Replace(Request.Form("name"),"'","''") password=Replace(Request.Form("password"),"'","''") repassword=Replace(Request.Form("repassword")," ","") email=Replace(Request.Form("email"),"'","''") adminid=Replace(Request.Form("adminid"),"'","''") sex=checknum(request.form("sex")) burn1=replace(Request.Form("burn1"),"'","") burn2=replace(Request.Form("burn2"),"'","") burn3=replace(Request.Form("burn3"),"'","") home=Replace(Request.Form("home"),"'","''") home=ubbg(home) qq=Replace(Request.Form("qq"),"'","''") gxqm=Request.Form("gxqm") gxqm=Replace(left(gxqm,255),"'","''") gxqm=replace(gxqm,"|","│") gxqm=checkbad(gxqm) picw=Replace(Request.Form("picw"),"'","''") pich=Replace(Request.Form("pich"),"'","''") mypic=Replace(Request.Form("mypic"),"'","''") mypic=ubbg(mypic) bbspic=Replace(Request.Form("bbspic"),"'","''") canreg=true function checkStr(str) if isnull(str) then checkStr = "" exit function end if checkStr=replace(str,"'","''") end function if name="" or password="" or repassword="" or email="" or adminid="" or sex="" then canreg=false mes="·请填写完整必填的资料。<br>" else mes="" if strlength(name)>16 then canreg=false mes="·你的用户名长度超过了16。<br>" end if if not pass_name(name) then canreg=false mes=mes&"·你的用户名含有非法字符。<br>" end if badwords=split(application(prefix&"badwords"),"|") for z=0 to ubound(badwords) if instr(name,badwords(z))>0 then canreg=false mes=mes&"·你的用户名含有论坛禁止使用的字词。<br>" exit for end if next if canreg=true then if not conn.execute("select top 1 userid from [user] where name='"&name&"'").eof then canreg=false:mes=mes&"·该用户名已经被注册了。<br>" end if if len(password)>16 then canreg=false : mes=mes&"·你填写的密码长度超过了16。<br>" sickpass=array(123,1234,12345,123456,1234567,12345678,"aaa",111) for i=0 to ubound(sickpass) if len(password)<3 or password=sickpass(i) then canreg=false mes=mes&"·你的密码属于弱口令,请更换密码。<br>" exit for end if next '限制用户名密码不能相同 if password=name then canreg=false mes=mes&"·你的密码属于弱口令,请更换密码。<br>" end if '结束 if repassword<>password then canreg=false : mes=mes&"·你两次输入的密码不一样。<br>" email=server.HTMLEncode(email) if not IsValidEmail(email) then canreg=false : mes=mes&"·你的E-mail填写错误。<br>" if session("adminid")<>adminid or not isnumeric(session("adminid")) then canreg=false:mes=mes&"·你输入的验证码错误。<br>" end if burn=burn1&"-"&burn2&"-"&burn3 if not isdate(burn) then burn="--" if qq<>"" and (not isnumeric(qq) or (len(qq)<5 or len(qq)>12)) then canreg=false:mes=mes&"·你的 QQ 号码填写错误。<br>" if mypic="" then toupic="images/headpic/"&bbspic&".gif|"&checknum(application(prefix&"autopicw"))&"|"&checknum(application(prefix&"autopich")) else if picw<>"" and checknum(picw)<=checknum(application(prefix&"picw")) and pich<>"" and checknum(pich)<=checknum(application(prefix&"pich")) then toupic=mypic&"|"&picw&"|"&pich else canreg=false mes=mes&"·你的头像大小设置错误。<br>" end if end if if checknum(application(prefix&"headpicset"))<>1 and instr(toupic,"://")>0 then canreg=false mes=mes&"·本论坛不允许使用外部头像。<br>" end if if canreg=false then tl=" 注 册 失 败" mes="<b>对不起!你不能成功地注册用户,可能存在以下问题。</b><br>"&mes&"·<a href='javascript:history.go(-1)'><img border=0 src="&styleid&"/re.gif align=absmiddle> 返回重新填写。</a>" elseif canreg=true then tl=" 注 册 成 功" mes="恭喜你!<b>"&checktitle(name)&"</b> 注册成功。<br>·<a href=login.asp>现在登陆论坛。</a><br>·<a href=index.asp>进入论坛首页。</a>"%> <!--#include file="inc/md5.asp"--> <% regtime=FormatDateTime(now+timeset/24,2) userinfo=email&"|"&home&"|"&burn&"|"&qq&"|"&sex&"|"&toupic&"|"&gxqm&"|"®time&"|" password=md5(password) set rs = Server.CreateObject("ADODB.Recordset") sql="select top 1 userid,name,password,userinfo,lasttime from [user]" rs.open sql,conn,0,2 rs.addnew rs("name")=name rs("password")=password rs("userinfo")=userinfo rs("lasttime")=regtime rs.update userid=rs("userid") rs.close set rs=nothing newuserinfo=userid&"|"&name conn.execute("update [config] set newuser='"&newuserinfo&"',usernum=usernum+1") end if call sendinfo(tl,mes) %> <%end select call down %>